//
//  PlugSuitPref.h
//  PlugSuit
//
//  Created by ∞ on 12/12/07.
//  Copyright (c) 2007 Emanuele Vulcano (infinite-labs.net). All rights reserved.
//

#import <PreferencePanes/PreferencePanes.h>
#define PlugSuitPref NetInfiniteLabsPlugSuitPreferencePane

@class PlSCFPreferences, PlSPlugIn, PlSUpdateUI, PlSTableView;

@interface PlugSuitPref : NSPreferencePane {
	IBOutlet NSImageView* _plusImageView;
	IBOutlet NSTextField* _enabledField;
	IBOutlet NSButton* _enabledButton;
	IBOutlet NSProgressIndicator* _spinner;
	BOOL _waitingForStartup;
	int _timesCheckedForStartup;
	
	NSMutableArray* _plugIns;
	NSMutableArray* _excludedApps;
	
	PlSCFPreferences* _prefs;
	
	NSArray* _managers;
	
	IBOutlet NSArrayController* _controller;
	IBOutlet NSArrayController* _appsController;
	
	IBOutlet NSTextField* _aboutTextField;
	IBOutlet NSPanel* _aboutPanel;
	
	IBOutlet NSPanel* _updatesPanel;
	
	PlSUpdateUI* _updateUI;
	BOOL _updatesFound;
	BOOL _internetDown;
	
	BOOL _migratingFrom1_0;
	
	IBOutlet PlSTableView* _plugInsView;
	IBOutlet PlSTableView* _appsView;
}

- (IBAction) enableDisable:(id) sender;

- (IBAction) addPlugIn:(id) sender;
- (IBAction) removePlugIn:(id) sender;

- (IBAction) addExcludedApplication:(id) sender;
- (IBAction) removeExcludedApplication:(id) sender;

- (IBAction) showPlugInInFinder:(id) sender;
- (IBAction) showExcludedApplicationInFinder:(id) sender;

- (IBAction) openPlugInWebSite:(id) sender;
- (IBAction) checkForPlugInUpdates:(id) sender;

- (IBAction) explainNotManaged:(id) sender;

- (void) updatePlugIns;
- (void) updateExcludedApplications;

@property(readonly) NSMutableArray* plugIns;
@property(readonly) NSMutableArray* excludedApplications;

- (NSString*) agentsDirectoryWithError:(NSError**) err;
- (void) enableWithUserInteraction;
- (void) disableWithUserInteraction;
- (BOOL) enableWithError:(NSError**) err;
- (BOOL) disableWithError:(NSError**) err;

- (id) defaultLaunchdPropertyList;
- (NSString*) pathToAgent;

@property(readonly) BOOL isEnabled;

- (IBAction) showAbout:(id) sender;
- (IBAction) showUpdatePreferences:(id) sender;
- (IBAction) hideUpdatePreferences:(id) sender;
- (IBAction) showPrivacyPolicy:(id) sender;
- (IBAction) checkNowForUpdates:(id) sender;

- (PlSCFPreferences*) preferences;

- (void) beginUpdatingApplication;
- (void) beginUpdatingPlugIns;
- (void) beginUpdatingApplicationExplicit;
- (void) beginUpdatingPlugInsExplicit;

- (void) installPlugInAtPath:(NSString*) plugInPath;
- (void) excludeApplicationAtPath:(NSString*) path;

- (IBAction) showHelp:(id) sender;

@end
